<template>
  <div class="my-play-list" @click="$parent.showMyPlayList = false">
    <div class="card">
      <ul>
        <h3>当前播放 <span>({{num}})</span> </h3>
        <SongListItem
          v-for="item in currentPlayList"
          :key="item.id"
          :item="item"
          @click.native="$emit('update:currentSong', item)"
          :currentSong="currentSong"
        ></SongListItem>
      </ul>
    </div>
  </div>
</template>

<script>
import SongListItem from "./SongListItem.vue";
export default {
  components: { SongListItem },
  props: {
    currentPlayList: Array,
    currentSong: Object
  },
  computed:{
    num:function(){
      return this.currentPlayList.length
    }
  }
};
</script>

<style lang="less">
.my-play-list {
  background: rgba(0, 0, 0, 0.5);
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  .card {
    width: 90vw;
    height: 60vh;
    background-color: #fff;
    border-radius: 20px;
    left: 5vw;
    bottom: 60px;
    margin-bottom: 60px;
    overflow-y: auto;
    ul{
      h3{
        margin: 0px 10px;
        padding: 10px 0 5px;
        font-weight: bold;
        span{
          font-size: 12px;
          font-weight: normal;
          color: #ccc;
        }
      }
    }
  }
}
</style>